<script setup>

</script>
<template>
  <div class="layout">
    <header>
      <h1> Vue-Bolg</h1>
      <nav>
        <router-link to="/" class="menu-link">首页</router-link>
        <router-link to="/posts" class="menu-link">文章</router-link>
        <router-link to="/about" class="menu-link">关于</router-link>
      </nav>
    </header>

    <main>
      <router-view />
    </main>

    <footer>
      @ 2025 my blog .用心输出
    </footer>
  </div>
</template>

<style scoped>
  .layout {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
  }

  header {
    background-color: #42b983;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  nav {
    display: flex;
    gap: 1rem;
  }

  .menu-link {
    color: white;
    text-decoration: none;
  }

  .menu-link.router-link-active {
    font-weight: bold;
    text-decoration: underline;
  }
  .router-link-active {
  color: #42b983; 
  font-weight: bold;
  border-bottom: 2px solid #42b983;
}

  main {
    flex: 1;
    padding: 2rem;
    background-color: #f5f5f5;
  }

  footer {
    background-color: #35495e;
    color: white;
    text-align: center;
    padding: 1rem;
  }


</style>